# -*- coding: utf-8 -*-
"""
@Author: Rengar
@e-mail: rengar.fan@amutec.cn
@Date: 2024/10/13
@Desc:
"""

from django.urls import path, include
from rest_framework.routers import DefaultRouter

from amat_app.adb_helper.adb_urls import adb_patterns
from amat_app.views import DeviceListView, DeviceRetrieveUpdateDeleteView, get_all_statuses, CaseViewSet, \
    CaseStepViewSet, StepResultViewSet, TestRunViewSet, SectionModelViewSet, ProjectViewSet, AppiumConfigViewSet

router = DefaultRouter()
router.register(r'cases', CaseViewSet)
router.register(r'steps', CaseStepViewSet)
router.register(r'results', StepResultViewSet)
router.register(r'test_runs', TestRunViewSet)
router.register(r'sections', SectionModelViewSet)
router.register(r'projects', ProjectViewSet)
router.register(r'appium_configs', AppiumConfigViewSet)
urlpatterns = [
    path('', include(router.urls)),
    path('devices/list', DeviceListView.as_view(), name='device-list'),
    path('devices/delete/<int:pk>', DeviceRetrieveUpdateDeleteView.as_view(), name='device_detail'),
    path('devices/update/<int:pk>', DeviceRetrieveUpdateDeleteView.as_view(), name='device_detail'),
    path('devices/info/<int:pk>', DeviceRetrieveUpdateDeleteView.as_view(), name='device_detail'),
    path('devices/statuses', get_all_statuses, name='device_statuses'),

]

urlpatterns += adb_patterns

print(urlpatterns)
